
<div class="sales index">
<ul class="itemsclosed">
<?php
$i = 0;
foreach ($sales as $sale):
?>
	
	<li>
		<table class="itemsTable">
			<tr>
				<td>
				
				<?php 	
							$photo = $sale['Item']['Photo'][0] ;
							echo $html->link($html->image('photos/home/'.$photo['urlPhoto'], array('width' => 100, 'height' => 150)),
											array('controller' => 'sales', 'action' => 'view', $sale['Sale']['id']),
											array('escape' => false));
							?>
							</td>
			</tr>
			<tr>
				<td><?php echo $html->link($sale['Item']['name'], array('controller' => 'items', 'action' => 'view', $sale['Item']['id'])); ?></td>
			</tr>
			<tr>
				<td>
					<?php 				
						echo $sale['Sale']['timeEnd'].'<br>';
						echo __('Lasted: ').$timediff->timeDiff($sale['Sale']['originalTimeEnd'],$sale['Sale']['timeEnd']);
					?>
				</td>
			</tr>
			<tr>
				<td>
				<?php
					echo round($sale['Sale']['currentPrice']*$currencyValue,2); 
					echo ' ';
					echo $currencyName;
				?>
				</td>
			</tr>
			<tr class="lastbidder">
				<td><?php echo $sale['User']['login']; ?></td>
			</tr>
		</table>
	</li> 
	

<?php 		$i++;
		endforeach; ?>
</ul>
</div>
<div class="paging">
	<?php echo $paginator->prev('<< '.__('previous', true), array(), null, array('class'=>'disabled'));?>
 | 	<?php echo $paginator->numbers();?>
	<?php echo $paginator->next(__('next', true).' >>', array(), null, array('class' => 'disabled'));?>
</div>
